/**
 * @author songgao
 */

var outputStyleTag = false;

function appendText(content){
    var ele = $("<div>");
    if (outputStyleTag) 
        ele.addClass("output1");
    else 
        ele.addClass("output2");
    outputStyleTag = !outputStyleTag;
    ele.append(document.createTextNode(content));
    $("#output").append(ele);
}

function getStatus(){
	$.post("adminService",{
		action: "getstatus"
	}, function(resp){
		appendText(resp);
	});
}

function startNewComputing(){
	$.post("adminService", {
		action: "startnewcomputing"
	},function(xml, status, req){
		appendText("response content:" + (new XMLSerializer()).serializeToString(xml));
	});
}

$(document).ready(function(){
    $("#getstatus").click(getStatus);
    $("#startnewcomputing").click(startNewComputing);

});